package com.gitee.cashzhang27.test.boot.functional.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 人实体.
 *
 * @author Cash Zhang
 * @version v1.0 2020/09/15 16:10
 * @since v1.0
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("person")
public class Person {

  // @IdMustBeExist
  @TableId(type = IdType.ASSIGN_UUID)
  private String id;

  @NotNull
  @Size(max = 64)
  @TableField("name")
  private String name;

  @TableField("sex")
  private String sex;

  @Min(0)
  @Max(150)
  @TableField("age")
  private Integer age;

}
